package com.aspectj.param;

import java.lang.reflect.Method;

public class JoinPoint {
	protected Signature signature;
	protected Object[] args;
	protected Object target;//连接点所在的目标对象； 
	protected Object this1;//代理对象本身；
	
	public JoinPoint(Signature signature, Object[] args, Object target, Object this1) {
		super();
		this.signature = signature;
		this.args = args;
		this.target = target;
		this.this1 = this1;
	}
	public Signature getSignature() {
		return signature;
	}
	public void setSignature(Signature signature) {
		this.signature = signature;
	}
	public Object[] getArgs() {
		return args;
	}
	public void setArgs(Object[] args) {
		this.args = args;
	}
	
	public Object getTarget() {
		return target;
	}
	public void setTarget(Object target) {
		this.target = target;
	}
	public Object getThis() {
		return this1.getClass().getName();
	}
	public void setThis(Object this1) {
		this.this1 = this1;
	}

	public static class Signature{
		private Method method;

		public Signature(Method method) {
			super();
			this.method = method;
		}

		public Method getMethod() {
			return method;
		}

		public void setMethod(Method method) {
			this.method = method;
		}

		public String getName() {
			return method!=null?method.getName():null;
		}

		public String getDeclaringTypeName() {
			return getDeclaringType().getName();
		}

		public int getModifiers() {
			return method.getModifiers();
		}

		public Class<?> getDeclaringType() {
			return method.getDeclaringClass();
		}
	}
}
